package structure_pattern.Decorator_pattern;

/**
 * @author fly
 * @since 2022/8/22 16:35
 * 滚动条装饰类：具体装饰类
 */
public class EngineCarDecorator extends CarDecorator {

    public EngineCarDecorator(Car car) {
        super(car);
    }

    @Override
    public void carType() {
       super.carType();
       // 不透明式，注掉，给客户端自己调用
       this.replace();
    }
    protected  void replace() {
        System.out.println("替换汽车发动机");
    }
}